home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / boot / netBoot / Genassym / genassym.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-05-13  |  3.1 KB  |  109 lines

  1.  
  2. /*
  3.  * @(#)genassym.c 1.1 86/09/27
  4.  * Copyright (c) 1986 by Sun Microsystems, Inc.
  5.  */
  6.  
  7. /*
  8.  * This module generates "assym.h" which contains all ".h" values
  9.  * needed by assembler code.  These values are automatically generated
  10.  * from the original ".h" files and automatically keep track of 
  11.  * structure rearrangements, etc.  However, the first time you use
  12.  * such a symbol, you have to add the printf() for it to this module.
  13.  */
  14.  
  15. #include "sunromvec.h"
  16. #include "cpu.addrs.h"
  17. #include "cpu.map.h"
  18. #include "interreg.h"
  19. #include "enable.h"
  20.  
  21. /*
  22.  * These unions are used to define page map entries and enable register
  23.  * values, and get at their hex representations.
  24.  */
  25. union longmap {
  26.     long    longval;
  27.     struct pgmapent pgmapent;
  28. };
  29.  
  30.  
  31. main()
  32. {
  33.     /*
  34.      * Declare assorted registers that we're interested in.
  35.      */
  36.     union longmap mapper;
  37.     struct intstack *ip = 0;    /* Assume structs start at 0 */
  38.     struct monintstack *mp = 0;
  39.  
  40.     /*
  41.      * Fields from cpu.addrs.h
  42.      */
  43.     printf("#define SERIAL0_BASE 0x%x\n", SERIAL0_BASE);
  44.     printf("#define INTERRUPT_BASE 0x%x\n", INTERRUPT_BASE);
  45.     printf("#define CLOCK_BASE 0x%x\n", CLOCK_BASE);
  46.     printf("#define MEMORY_ERR_BASE 0x%x\n", MEMORY_ERR_BASE);
  47.     printf("#define MONBSS_BASE 0x%x\n", MONBSS_BASE);
  48.     printf("#define STACK_BASE 0x%x\n", STACK_BASE);
  49.     printf("#define TRAPVECTOR_BASE 0x%x\n", TRAPVECTOR_BASE);
  50.     printf("#define PROM_BASE 0x%x\n", PROM_BASE);
  51.  
  52.     /*
  53.      * Fields from cpu.map.h
  54.      */
  55.     printf("\n");
  56.     printf("#define NUMCONTEXTS %d\n", NUMCONTEXTS);
  57.     printf("#define NUMPMEGS %d\n", NUMPMEGS);
  58.     printf("#define PGSPERSEG %d\n", PGSPERSEG);
  59.     printf("#define BYTESPERPG %d\n", BYTESPERPG);
  60.     printf("#define BYTES_PG_SHIFT %d\n", BYTES_PG_SHIFT);
  61.     printf("#define ADRSPC_SIZE 0x%x\n", ADRSPC_SIZE);
  62.     printf("#define    MAPADDRMASK 0x%x\n", MAPADDRMASK);
  63.     printf("#define PMAPOFF 0x%x\n", PMAPOFF);
  64.     printf("#define SMAPOFF 0x%x\n", SMAPOFF);
  65.     printf("#define    IDPROMOFF 0x%x\n", IDPROMOFF);
  66.     printf("#define CONTEXTOFF 0x%x\n", CONTEXTOFF);
  67.     printf("#define CONTEXTMASK 0x%x\n", CONTEXTMASK);
  68.     printf("#define FC_MAP 0x%x\n", FC_MAP);
  69.     printf("#define FC_SP 0x%x\n", FC_SP);
  70.     printf("#define LEDOFF 0x%x\n", LEDOFF);
  71.     printf("#define ENABLEOFF 0x%x\n", ENABLEOFF);
  72.     printf("#define BUSERROFF 0x%x\n", BUSERROFF);
  73.     printf("#define PMREALBITS 0x%x\n", PMREALBITS);
  74.  
  75.     printf("\n");
  76.  
  77.     /* Page map entry for the canonical invalid page */
  78.     mapper.longval = 0;
  79.     mapper.pgmapent.pm_valid    = 0;
  80.     mapper.pgmapent.pm_permissions    = PMP_RO_SUP;
  81.     mapper.pgmapent.pm_type        = VPM_MEMORY;
  82.     mapper.pgmapent.pm_accessed    = 0;
  83.     mapper.pgmapent.pm_modified    = 0;
  84.     mapper.pgmapent.pm_page        = 0;
  85.     printf("#define PME_INVALID 0x%x\n", mapper.longval);
  86.  
  87.     /*
  88.      * Fields from interreg.h
  89.      */
  90.     printf("\n");
  91.     printf("#define    IR_ENA_INT 0x%x\n", IR_ENA_INT);
  92.     printf("#define    IR_ENA_CLK7 0x%x\n", IR_ENA_CLK7);
  93.  
  94.     /*
  95.      * Fields from enable.h
  96.      */
  97.     printf("\n");
  98.     printf("#define    ENA_DIAG 0x%x\n", ENA_DIAG);
  99.     printf("#define    ENA_COPY 0x%x\n", ENA_COPY);
  100.     printf("#define    ENA_VIDEO 0x%x\n", ENA_VIDEO);
  101.     printf("#define    ENA_CACHE 0x%x\n", ENA_CACHE);
  102.     printf("#define    ENA_SDVMA 0x%x\n", ENA_SDVMA);
  103.     printf("#define    ENA_FPP 0x%x\n", ENA_FPP);
  104.     printf("#define    ENA_NOTBOOT 0x%x\n", ENA_NOTBOOT);
  105.  
  106.     exit(0);
  107. }
  108.  
  109.